<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        const arr = []
        function getMax() {
            var max = arguments[0];
            for (var i = 1; i < arguments.length; i++) {
                if (arguments[i] > max) {
                    max = arguments[i]
                }
            }
            return max;
        }
        console.log(getMax(0, 22, 11, 44, 33, 77, 66));
        // console.log(getMax(0, 22, 11, 44, 33, 99, 77.7));
        // ES6解构赋值传参
        function getMaxNumber(...args) {
            if (args.length === 0) {
                return args;
            }
            let max = args[0];
            for (let i = 1; i < args.length; i++) {
                if (args[i] > max) {
                    max = args[i];
                }
            }
            return max;

        }
        console.log(getMaxNumber(0, 22, 11, 44, 33, 77, 66));
        console.log(Math.max(0, 22, 11, 44, 33, 77, 66));


    </script>
</head>

<body>

</body>

</html>